﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using STT.Admin.UserControls;
using System.Web.UI.HtmlControls;

namespace STT.Admin
{
    public partial class Default : System.Web.UI.Page
    {
         public Control kh;
         public string kt;
        protected void Page_Load(object sender, EventArgs e)
        {

            //if (Request.QueryString["idpage"] == null)
            if (Request.QueryString["idpage"] == null)
            {
                Response.Redirect("~/Admin/Default.aspx?idpage=1");
            }
            else 
            {
                kt = Request.QueryString["idpage"].ToString().Trim();
                HtmlGenericControl gel = new HtmlGenericControl("div");
                if (kt == "tc")
                {
                    if (Session["name"] == null && Session["role"] == null)
                    {
                        Response.Redirect("Default.aspx?idpage=home");
                    }
                    else if (Session["name"] != null && Session["role"] != null)
                    {
                        if (Session["role"].ToString() == "admin")
                        {
                            qltk.Visible = true;
                        }
                        else if (Session["role"].ToString() == "user1")
                        {
                            qltk.Visible = false;
                            qlnd.Enabled = false;
                            qlpq.Enabled = false;
                        }
                        else if (Session["role"].ToString() == "user2")
                        {
                            qltk.Visible = false;
                            qlnd.NavigateUrl = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qlpq.NavigateUrl = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qlnn.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qlhv.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qlbangcap.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qlbchv.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qlcv.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qldiem.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qldonvi.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qlgv.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qlkh.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qlkhgv.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qllh.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qlltt.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qlmh.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qlnganh.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qlnn.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qlnngv.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qlnnhv.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qlpb.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qltdcm.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qltdhv.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qltkb.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                            qltt.HRef = "javascript:alert('Bạn không có quyền sử dụng chức năng này..!');";
                        }
                        PlaceHolder.Controls.Clear();
                        kh = Page.LoadControl("UserControls/ucTrangChu.ascx");
                    }
                    else if (Session["name"] != null && Session["role"] == null)
                    {
                        Response.Redirect("~/Admin/login.aspx");
                    }
                }

                else if (kt == "qlkh")
                {
                    if (Session["name"] == null && Session["role"] == null)
                    {
                        Response.Redirect("~/Default.aspx?mod=Home");
                    }
                    else if (Session["name"] == null && Session["role"] != null)
                    {

                        if (Session["role"].ToString() == "admin")
                        {
                            qltk.Visible = true;

                        }
                        else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                        {
                            qltk.Visible = false;

                        }
                        PlaceHolder.Controls.Clear();
                        kh = Page.LoadControl("UserControls/ucKhoaHoc.ascx");
                    }
                    else if (kt == "qltt")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucTinTuc.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                
                    else if (kt == "qlbchv")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucHocVienBangCap.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qlnnhv")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucHocVienNgoaiNgu.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qldiem")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucBangDiem.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qlgv")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucGiangVien.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qlnngv")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucGiangVien_NgoaiNgu.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qllh")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucLop.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qltkb")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucTKB.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qlkhgv")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucKhoaHocGiangVien.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qlmh")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucMonHoc.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qltdcm")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucTDChuyenMon.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qltdhv")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucTDHocVan.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qlnganh")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucNganh.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qldonvi")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucDonVi.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qlcv")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucChucVu.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qlbangcap")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucBangCap.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qlnn")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucNgoaiNgu.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qlpb")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucPhongBan.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qlltt")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucLoaiTinTuc.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "tkhv")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucTimKiemHocVien.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "tkgv")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucTimKiemGiangVien.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "tkkh")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucTimKiemKhoaHoc.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                    else if (kt == "qlhv")
                    {
                        if (Session["name"] == null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=Home");
                        }
                        else if (Session["name"] == null && Session["role"] != null)
                        {

                            if (Session["role"].ToString() == "admin")
                            {
                                qltk.Visible = true;

                            }
                            else if (Session["role"].ToString() == "user1" || Session["role"].ToString() == "user2")
                            {
                                qltk.Visible = false;

                            }
                            PlaceHolder.Controls.Clear();
                            kh = Page.LoadControl("UserControls/ucHocVien.ascx");
                        }

                        else if (Session["name"] != null && Session["role"] == null)
                        {
                            Response.Redirect("~/Default.aspx?mod=rs173&key=content");
                        }

                        gel.Controls.Add(kh);
                        PlaceHolder.Controls.Add(gel);

                    }
                }

            }

            if (Request.QueryString["idpage"] != null)
            {
                PlaceHolder.Controls.Clear();

                if (Request.QueryString["idpage"] == "1")
                    PlaceHolder.Controls.Add(LoadControl("UserControls/ucTrangChu.ascx"));
                else
                    if (Request.QueryString["idpage"] == "2")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucBangCap.ascx"));
                else
                    if (Request.QueryString["idpage"] == "10")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucKhoaHoc.ascx"));
                else
                    if (Request.QueryString["idpage"] == "14")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucThemTKB.ascx"));
                else
                    if (Request.QueryString["idpage"] == "11")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucTKB.ascx"));
                else
                    if (Request.QueryString["idpage"] == "16")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucThemTinTuc.ascx"));
                else
                    if (Request.QueryString["idpage"] == "15")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucTinTuc.ascx"));
                else
                    if (Request.QueryString["idpage"] == "tkhv")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucTimKiemHocVien.ascx"));
                else
                    if (Request.QueryString["idpage"] == "tkgv")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucTimKiemGiangVien.ascx"));
                else
                    if (Request.QueryString["idpage"] == "tkkh")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucTimKiemKhoaHoc.ascx"));
                else
                    if (Request.QueryString["idpage"] == "lkgv")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucThongKeGiangVien.ascx"));
                else
                    if (Request.QueryString["idpage"] == "lkhv")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucThongKeHocVien.ascx"));
                else
                        if (Request.QueryString["idpage"] == "lkhk")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucThongKeKhoaHoc.ascx"));
               else
                    if (Request.QueryString["idpage"] == "qltdcm")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucTDChuyenMon.ascx"));
                else
                    if (Request.QueryString["idpage"] == "qlbchv")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucHocVienBangCap.ascx"));
                else
                    if (Request.QueryString["idpage"] == "qlnnhv")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucHocVienNgoaiNgu.ascx"));
                else
                    if (Request.QueryString["idpage"] == "qldiem")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucBangDiem.ascx"));
                else
                    if (Request.QueryString["idpage"] == "qlgv")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucGiangVien.ascx"));
                else
                    if (Request.QueryString["idpage"] == "qlnngv")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucGiangVien_NgoaiNgu.ascx"));
                else
                    if (Request.QueryString["idpage"] == "qllh")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucLop.ascx"));
                
                else
                    if (Request.QueryString["idpage"] == "qlkhgv")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucKhoaHocGiangVien.ascx"));
                else
                    if (Request.QueryString["idpage"] == "qlmh")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucMonHoc.ascx"));
                else
                    if (Request.QueryString["idpage"] == "qltdhv")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucTDHocVan.ascx"));
                else
                    if (Request.QueryString["idpage"] == "qlnganh")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucNganh.ascx"));
                else
                    if (Request.QueryString["idpage"] == "qldv")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucDonVi.ascx"));
                else
                    if (Request.QueryString["idpage"] == "qlcv")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucChucVu.ascx"));
                 else
                    if (Request.QueryString["idpage"] == "qlbc")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucBangCap.ascx"));
                 else
                    if (Request.QueryString["idpage"] == "qlnn")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucNgoaiNgu.ascx"));
                 else
                    if (Request.QueryString["idpage"] == "qlpb")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucPhongBan.ascx"));
                 else
                    if (Request.QueryString["idpage"] == "qlltt")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucLoaiTinTuc.ascx"));
                else
                    if (Request.QueryString["idpage"] == "qlhv")
                        PlaceHolder.Controls.Add(LoadControl("UserControls/ucHocVien.ascx"));
            }
        }
     
        

        protected void lbtnthoat_Click(object sender, EventArgs e)
        {
            Session["name"] = null;
            Session["role"] = null;
            Session["Mahv"] = null;
            Response.Redirect("~/Admin/login.aspx");
        }
    }
}